home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2000 #4 / Amiga Plus CD - 2000 - No. 4.iso / Tools / Musik / Misc / Amster / Source / include / share.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-05-27  |  2.5 KB  |  99 lines

  1. /*
  2. ** File sharing header
  3. */
  4.  
  5. #include <sys/types.h>
  6.  
  7. #include "include/mui.h"
  8.  
  9. #ifndef AMSTER_SHARE_H
  10. #define AMSTER_SHARE_H
  11.  
  12.  
  13. /* Events */
  14.  
  15. #define SHARE_OPEN      0x7001
  16. #define SHARE_CLOSE     0x7002
  17. #define SHARE_ADD       0x7003
  18. #define SHARE_ADDDIR    0x7004
  19. #define SHARE_REMOVE    0x7005
  20. #define SHARE_LOAD      0x7006
  21. #define SHARE_LOADAS    0x7007
  22. #define SHARE_SAVE      0x7008
  23. #define SHARE_SAVEAS    0x7009
  24. #define SHARE_UPLOAD    0x7010
  25. #define SHARE_NOTIFYALL 0x7011
  26. #define SHARE_PLAY      0x7012
  27. #define SHARE_ADDFILE   0x7013
  28. #define SHARE_ADDFILEN  0x7014
  29.  
  30.  
  31. /* Argument array for parsing sharing file */
  32.  
  33. #define ARG_PATH    0
  34. #define ARG_MD5     1
  35. #define ARG_SIZE    2
  36. #define ARG_BITRATE 3
  37. #define ARG_FREQ    4
  38. #define ARG_TIME    5
  39.  
  40.  
  41. extern char sharepath[512];
  42. extern BOOL sharechanged;
  43.  
  44. typedef struct sharedata_struct {
  45.     char title[256];
  46.     char md5[33];
  47.     unsigned long size;
  48.     int bitrate, freq, time;
  49. } *sharedata, _sharedata;
  50.  
  51.  
  52. /* GUI elements */
  53.  
  54. struct shdata {
  55.     u_long *list, *stat;
  56. };
  57.  
  58.  
  59. /* Prototypes */
  60.  
  61. MUIF share_dispatch(REG(a0) struct IClass *cl, REG(a2) Object *obj, REG(a1) Msg msg);
  62. ULONG share_new(struct IClass *cl, Object *obj, struct opSet *msg);
  63. MUIF sharelistdest(REG(a2) APTR pool, REG(a1) sharedata sd);
  64. MUIF sharelistdisp(REG(a2) char **array, REG(a1) sharedata sd);
  65. MUIF sharelistcomp(REG(a0) struct Hook *hook, REG(a2) Object *obj, REG(a1) struct NList_CompareMessage *ncm);
  66. MUIF ShareListAppMsgFunc(REG(a2) APTR obj, REG(a1) struct AppMessage **x);
  67.  
  68. /* Private */
  69.  
  70. void add_filename(struct shdata *data, char *fname);
  71. void add_file(struct shdata *data, song sdl, char *fname);
  72. void add_shares(struct shdata *data);
  73. void add_directory(struct shdata *data);
  74. void add_recursive(struct shdata *data, sharedata sd, BPTR dirlock, const char *dirname);
  75. void add_shareinfo(struct shdata *data, sharedata sd, BPTR lock);
  76. void notify_shares(struct shdata *data);
  77. void remove_shares(struct shdata *data, long t);
  78. void save_shares(struct shdata *data);
  79. void save_shares_as(struct shdata *data);
  80. void load_shares(struct shdata *data);
  81. void load_shares_as(struct shdata *data);
  82. void update_stat(struct shdata *data);
  83. void play_share(struct shdata *data);
  84.  
  85. void upload_req(char *user, char *fname);
  86. void upload_file_confirm(struct shdata *data, char *user, char *fname);
  87.  
  88. void nap_notifyshare(sharedata sd);
  89.  
  90. BOOL IsIn(char *string, char c);
  91.  
  92. /* Public prototypes */
  93.  
  94. extern char *strrep(char *str1, char *old_str, char *new_str);
  95. extern char *MakeWinPath(char *AmigaPath);
  96.  
  97.  
  98. #endif  /* AMSTER_SHARE_H */
  99.